﻿#ifndef LOG_H
#define LOG_H

#include <string>

// 日志等级
#define Info 0
#define Debug 1
#define Warning 2
#define Error 3
#define Fatal 4

#define SIZE 1024

#define screen 1
#define onefile 2
#define classfile 3

#define logfile "log.txt"

class logger
{
private:
    int printMethod;
    std::string path;

public:
    logger();  // 添加构造函数声明
    
    void ChangeDev(int method);
    std::string leveltostring(int level);
    void printonefile(const std::string &filename, const std::string &logtxt);
    void printclassfile(int level, const std::string &logtxt);
    void printlog(int level, std::string logtxt);
    void operator()(int level, const char *format, ...);
};

extern logger LOG;

#endif